package com.leco.exam.common.biz.exception;

import com.leco.exam.common.biz.errorcode.ErrorCode;

/**
 * @author greg
 * @version 2022/9/8
 **/
public class ExamException extends RuntimeException {
    private int code;

    public void setCode(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public ExamException(String message) {
        super(message);
    }

    public ExamException(String message, ErrorCode code) {
        super(message);
        this.code = code.getCode();
    }


    public ExamException(ErrorCode code) {
        super(code.getMessage());
        this.code = code.getCode();
    }

    public ExamException(String message, int code) {
        super(message);
        this.code = code;
    }
}
